﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional

namespace Furion.Database.Migrations.Migrations
{
    /// <inheritdoc />
    public partial class Init001 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterDatabase()
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "Dictionary",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Name = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false, comment: "名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "软删除标记")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Dictionary", x => x.Id);
                },
                comment: "数据字典")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "DictionaryItem",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Name = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false, comment: "名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Code = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "代码")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ParentId = table.Column<int>(type: "int", nullable: false, comment: "上级Id"),
                    DictionaryId = table.Column<int>(type: "int", nullable: false, comment: "代码"),
                    Ord = table.Column<int>(type: "int", nullable: false, comment: "序号"),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "软删除标记")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DictionaryItem", x => x.Id);
                },
                comment: "数据字典配置项")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "Org",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Title = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ManagerId = table.Column<long>(type: "bigint", nullable: false, comment: "负责人"),
                    ParentId = table.Column<int>(type: "int", nullable: false, comment: "上级Id"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Org", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "Permission",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    PermissionName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "权限名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    PermissionCode = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "权限代码")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Ord = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否启用"),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "分组"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    CreatedUserName = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "创建者名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id"),
                    UpdatedUserName = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "修改者名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "软删除标记"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Permission", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "Policy",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false, comment: "主键"),
                    Title = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "标题")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    PostDepart = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "发布部门")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Summay = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "简介")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Contents = table.Column<string>(type: "longtext", nullable: true, comment: "内容")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Statu = table.Column<int>(type: "int", nullable: false, comment: "数据状态"),
                    CreatedTime = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "创建时间"),
                    UpdatedTime = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "更新时间"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    CreatedUserName = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "创建者名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id"),
                    UpdatedUserName = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "修改者名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "软删除标记")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Policy", x => x.Id);
                },
                comment: "产业政策")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "Role",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "角色名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Remark = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "角色描述")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否启用"),
                    CreatedTime = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "创建时间"),
                    UpdatedTime = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "更新时间"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    CreatedUserName = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "创建者名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id"),
                    UpdatedUserName = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "修改者名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "软删除标记")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Role", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "User",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false, comment: "主键"),
                    UserName = table.Column<string>(type: "varchar(32)", maxLength: 32, nullable: false, comment: "账号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    UserPass = table.Column<string>(type: "varchar(32)", maxLength: 32, nullable: false, comment: "密码")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    NickName = table.Column<string>(type: "varchar(32)", maxLength: 32, nullable: true, comment: "昵称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ImageUrl = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "头像")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Remark = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "简介")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Mobile = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "手机")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    OrgId = table.Column<int>(type: "int", nullable: false, comment: "部门Id"),
                    LoginTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "最近登录时间"),
                    Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否启用"),
                    OpenId = table.Column<string>(type: "longtext", nullable: true, comment: "微信OpenId")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreatedTime = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "创建时间"),
                    UpdatedTime = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "更新时间"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    CreatedUserName = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "创建者名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id"),
                    UpdatedUserName = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "修改者名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "软删除标记")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_User", x => x.Id);
                },
                comment: "用户表")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "RolePermission",
                columns: table => new
                {
                    RoleId = table.Column<int>(type: "int", nullable: false, comment: "角色Id"),
                    PermissionId = table.Column<int>(type: "int", nullable: false, comment: "权限Id")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RolePermission", x => new { x.RoleId, x.PermissionId });
                    table.ForeignKey(
                        name: "FK_RolePermission_Permission_PermissionId",
                        column: x => x.PermissionId,
                        principalTable: "Permission",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_RolePermission_Role_RoleId",
                        column: x => x.RoleId,
                        principalTable: "Role",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "UserRole",
                columns: table => new
                {
                    UserId = table.Column<long>(type: "bigint", nullable: false, comment: "用户Id"),
                    RoleId = table.Column<int>(type: "int", nullable: false, comment: "角色Id")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserRole", x => new { x.UserId, x.RoleId });
                    table.ForeignKey(
                        name: "FK_UserRole_Role_RoleId",
                        column: x => x.RoleId,
                        principalTable: "Role",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_UserRole_User_UserId",
                        column: x => x.UserId,
                        principalTable: "User",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.InsertData(
                table: "Permission",
                columns: new[] { "Id", "CreatedTime", "CreatedUserId", "CreatedUserName", "Enabled", "IsDeleted", "Ord", "PermissionCode", "PermissionName", "Sort", "UpdatedTime", "UpdatedUserId", "UpdatedUserName" },
                values: new object[,]
                {
                    { 1, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7106), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "user.profile", "当前登录用户", 0, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7107), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 2, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7121), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "user.list", "用户列表", 0, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7123), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 3, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7126), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "user.edit", "用户信息编辑", 0, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7127), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 4, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7137), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "user.delete", "用户删除", 0, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7138), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 5, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7142), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "user.add", "用户新增", 0, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7143), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 6, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7149), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "user.change_password", "用户密码修改", 0, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7150), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 7, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7153), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "file.upload", "文件上传", 1, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7154), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 8, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7157), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "file.download", "文件下载", 1, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7158), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 9, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7161), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "org.add", "部门新增", 2, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7162), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 10, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7167), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "org.edit", "部门编辑", 2, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7168), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 11, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7171), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "org.delete", "部门删除", 2, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7172), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 12, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7175), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "org.list", "部门列表", 2, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7213), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 13, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7216), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "permission.add", "权限新增", 3, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7217), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 14, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7221), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "permission.edit", "权限编辑", 3, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7222), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 15, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7225), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "permission.delete", "权限删除", 3, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7226), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 16, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7229), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "permission.list", "权限列表", 3, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7230), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 17, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7233), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "role.add", "角色新增", 4, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7234), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 18, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7239), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "role.edit", "角色编辑", 4, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7240), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 19, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7243), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "role.delete", "角色删除", 4, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7244), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 20, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7247), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "role.list", "角色列表", 4, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7248), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 21, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7251), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "role.permission", "角色权限设置", 4, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7252), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 22, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7255), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "policy.add", "政策新增", 5, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7256), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 23, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7261), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "policy.edit", "政策编辑", 5, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7262), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 24, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7265), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "policy.delete", "政策删除", 5, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7266), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 25, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7269), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "policy.list", "政策列表", 5, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7270), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 26, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7273), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "policy.recovery", "政策恢复", 5, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7274), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 27, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7278), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "policy.importout", "政策导出", 5, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7279), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 28, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7282), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "dictionary.add", "字典新增", 6, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7283), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 29, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7286), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "dictionary.edit", "字典编辑", 6, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7287), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 30, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7291), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "dictionary.delete", "字典删除", 6, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7292), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 31, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7297), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "dictionary.list", "字典列表", 6, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7298), new TimeSpan(0, 8, 0, 0, 0)), null, null },
                    { 32, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7301), new TimeSpan(0, 8, 0, 0, 0)), null, null, true, false, 0, "dictionary.recovery", "字典恢复", 6, new DateTimeOffset(new DateTime(2023, 5, 4, 22, 56, 27, 661, DateTimeKind.Unspecified).AddTicks(7302), new TimeSpan(0, 8, 0, 0, 0)), null, null }
                });

            migrationBuilder.InsertData(
                table: "Role",
                columns: new[] { "Id", "CreatedTime", "CreatedUserId", "CreatedUserName", "Enabled", "IsDeleted", "Name", "Remark", "UpdatedTime", "UpdatedUserId", "UpdatedUserName" },
                values: new object[,]
                {
                    { 1, new DateTime(2023, 5, 4, 22, 56, 27, 664, DateTimeKind.Local).AddTicks(2441), null, null, true, false, "管理员", "管理员", new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, null },
                    { 99, new DateTime(2023, 5, 4, 22, 56, 27, 664, DateTimeKind.Local).AddTicks(2446), null, null, true, false, "小程序用户", "小程序用户", new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, null }
                });

            migrationBuilder.InsertData(
                table: "User",
                columns: new[] { "Id", "CreatedTime", "CreatedUserId", "CreatedUserName", "Enabled", "ImageUrl", "IsDeleted", "LoginTime", "Mobile", "NickName", "OpenId", "OrgId", "Remark", "UpdatedTime", "UpdatedUserId", "UpdatedUserName", "UserName", "UserPass" },
                values: new object[] { 1L, new DateTime(2023, 5, 4, 22, 56, 27, 665, DateTimeKind.Local).AddTicks(1482), null, null, true, "", false, new DateTime(2023, 5, 4, 22, 56, 27, 665, DateTimeKind.Local).AddTicks(1484), null, "管理员", "", 0, "", new DateTime(2023, 5, 4, 22, 56, 27, 665, DateTimeKind.Local).AddTicks(1487), null, null, "admin", "e10adc3949ba59abbe56e057f20f883e" });

            migrationBuilder.InsertData(
                table: "RolePermission",
                columns: new[] { "PermissionId", "RoleId" },
                values: new object[,]
                {
                    { 1, 1 },
                    { 2, 1 },
                    { 3, 1 },
                    { 4, 1 },
                    { 5, 1 },
                    { 6, 1 },
                    { 7, 1 },
                    { 8, 1 },
                    { 9, 1 },
                    { 10, 1 },
                    { 11, 1 },
                    { 12, 1 },
                    { 13, 1 },
                    { 14, 1 },
                    { 15, 1 },
                    { 16, 1 },
                    { 17, 1 },
                    { 18, 1 },
                    { 19, 1 },
                    { 20, 1 },
                    { 21, 1 },
                    { 22, 1 },
                    { 23, 1 },
                    { 24, 1 },
                    { 25, 1 },
                    { 26, 1 },
                    { 27, 1 },
                    { 28, 1 },
                    { 29, 1 },
                    { 30, 1 },
                    { 31, 1 },
                    { 32, 1 },
                    { 1, 99 },
                    { 2, 99 },
                    { 3, 99 },
                    { 6, 99 },
                    { 7, 99 },
                    { 8, 99 },
                    { 22, 99 },
                    { 23, 99 },
                    { 24, 99 },
                    { 25, 99 },
                    { 26, 99 },
                    { 27, 99 }
                });

            migrationBuilder.InsertData(
                table: "UserRole",
                columns: new[] { "RoleId", "UserId" },
                values: new object[] { 1, 1L });

            migrationBuilder.CreateIndex(
                name: "IX_RolePermission_PermissionId",
                table: "RolePermission",
                column: "PermissionId");

            migrationBuilder.CreateIndex(
                name: "IX_UserRole_RoleId",
                table: "UserRole",
                column: "RoleId");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Dictionary");

            migrationBuilder.DropTable(
                name: "DictionaryItem");

            migrationBuilder.DropTable(
                name: "Org");

            migrationBuilder.DropTable(
                name: "Policy");

            migrationBuilder.DropTable(
                name: "RolePermission");

            migrationBuilder.DropTable(
                name: "UserRole");

            migrationBuilder.DropTable(
                name: "Permission");

            migrationBuilder.DropTable(
                name: "Role");

            migrationBuilder.DropTable(
                name: "User");
        }
    }
}
